package com.wh.minio.container;

import org.apache.commons.lang.StringUtils;
import com.jiangshikun.parrot.dao.RedisBaseDao;
import com.jiangshikun.parrot.dao.StringDao;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:minio-applicationContext.xml")
public class SpringCtxTst {

    @Value("${wh.minio.endpoint}")
    private String endpoint;

    @Value("${wh.minio.accessKey}")
    private String accessKey;

    @Value("${wh.minio.secretKey}")
    private String secretKey;

    private StringDao stringDao = RedisBaseDao.getStringDao();

    public StringDao getStringDao() {
        return stringDao;
    }

    public void setStringDao(StringDao stringDao) {
        this.stringDao = stringDao;
    }

    @Test
    public void test(){
        System.out.println("endpoint:" + endpoint);
        System.out.println("accessKey:"  + accessKey);
        System.out.println("secretKey:"  + secretKey);
        stringDao.save("123123", "123123", 10);
        System.out.println("sdfdsf: " + stringDao.getValue("123123"));
    }


}
